* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #fff;
}

/* 头部样式 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-title h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.note-count {
    color: #999;
    font-size: 12px;
}

.clear-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.clear-btn:hover {
    background: #f0f0f0;
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f5f5f5;
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: #999;
}

.system-message {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    display: inline-block;
    max-width: 250px;
}

.system-message span {
    font-weight: 600;
    color: #1890ff;
}

.system-message p {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

/* 笔记消息样式 */
.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble {
    background: #07c160;
    color: white;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-right-radius: 6px;
    max-width: 80%;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
}

.message-bubble:hover {
    transform: scale(1.02);
}

.message-bubble:active {
    transform: scale(0.98);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    margin-right: 5px;
}

/* 编辑状态 */
.message-bubble.editing {
    background: #ffeaa7;
    color: #333;
    border: 2px solid #fdcb6e;
}

/* 输入区域 */
.input-container {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e6e6e6;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    background: #f8f8f8;
    border: 1px solid #e6e6e6;
    border-radius: 20px;
    padding: 8px 15px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: #07c160;
    background: #fff;
}

#noteInput {
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    min-height: 20px;
    max-height: 100px;
    color: #333;
    font-family: inherit;
}

#noteInput::placeholder {
    color: #999;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.page-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
    color: #666;
    margin-right: 5px;
}

.page-btn:hover {
    background: #f0f0f0;
    color: #07c160;
}

.char-count {
    font-size: 11px;
    color: #999;
    margin: 0 auto;
}

.send-btn {
    background: #07c160;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    opacity: 0.6;
}

.send-btn:enabled {
    opacity: 1;
}

.send-btn:hover:enabled {
    background: #06ad56;
    transform: scale(1.1);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    cursor: not-allowed;
    background: #ccc;
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 5px 0;
    z-index: 1000;
    display: none;
    min-width: 120px;
}

.menu-item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background: #f5f5f5;
}

/* 响应式设计 */
@media (max-width: 300px) {
    .chat-header {
        padding: 10px 15px;
    }
    
    .header-title h3 {
        font-size: 14px;
    }
    
    .message-bubble {
        max-width: 90%;
        padding: 10px 12px;
    }
    
    .input-container {
        padding: 10px 15px;
    }
}

/* 滚动条美化 */
.messages-container {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* 空状态 */
.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 截图相关样式 */
.screenshot-bubble {
    background: #4a90e2 !important;
    max-width: 90% !important;
    padding: 10px !important;
}

.screenshot-text {
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.3;
}

.screenshot-container {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
}

.screenshot-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
}

.screenshot-image:hover {
    transform: scale(1.02);
}